using System;
using Native_;
namespace Capture.MME
{
    /// <summary>
    /// DeviceInfo
    /// </summary>
    public struct DeviceInfo
    {
        public static readonly DeviceInfo Empty = new DeviceInfo();
        public int Device;
        // 1 channel VALUE1 VALUE1 VALUE1 VALUE1..
        // 2 channel VALUE1 VALUE2 VALUE1 VALUE2.. 
        public int Channels;

        public static DeviceInfo GetDefaultDevice()
        {
            var devices = GetDevices();
            return (devices == 0 ? Empty : new DeviceInfo
            {
                Device = 0,
                Channels = 1,
            });
        }

        public static int GetDevices()
        {
            return WindowsMultimedia.waveInGetNumDevs();
        }
    }
}
